<template>
  <div>{{msg}}

    <button @click="getDemoInfo">点击获取后端数据</button>
  </div>

</template>

<script>
  import { demoInfo } from "@/api/demo";

  export default {
      name: "demoInfo",
      data(){
        return {
          msg:"我是前端demo测试"
        }
      },
      methods:{
        //后去后端地址
        getDemoInfo(){
          demoInfo().then(response => {
            console.log("demo数据");
            console.log(response);
            this.msg = response.data;
          });
        }
      }
  }
</script>
